﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.Globalization;

namespace WTwitter.Model.SearchTwitter {
	/// <summary>
	/// Search APIの検索結果(Json形式)
	/// </summary>
	[DataContract]
	public class Status : IEquatable<Status> {
		[DataMember(Name="text")]
		public string Text { get; set; }

		[DataMember(Name="from_user")]
		public string UserName {get; set;}

		[DataMember(Name = "from_user_id")]
		public long? FromUserId { get; set; }

		[DataMember(Name="id")]
		public long Id {get; set;}

		[DataMember(Name = "created_at")]
		public string CreatedAtString { get; set; }

		[DataMember(Name = "profile_image_url")]
		public string ProfileImageUrl { get; set; }

		[DataMember(Name = "to_user_id")]
		public long? ToUserId { get; set; }

		[DataMember(Name = "to_user")]
		public string ToUser { get; set; }

		[DataMember(Name = "source")]
		public string Source { get; set; }

		#region IEquatable<Status> メンバ

		public bool Equals(Status other) {
			return this.Id == other.Id;
		}

		#endregion

		public override int GetHashCode() {
			return this.Id.GetHashCode();
		}

		public override string ToString() {
			return this.UserName + ":" + this.Id.ToString();
		}
	}
}
